﻿package bdz.common.model
{
	import flash.events.EventDispatcher;
	import flash.utils.Dictionary;

	public class AppEnvironment extends EventDispatcher
	{
		private static var instance:AppEnvironment;
		private static var objectDictionary:Dictionary;
		
		function AppEnvironment(paccess:PrivateAccess){
			if(paccess == null){
				throw new Error("NullPointerException...");
			}
		}
		public static function getEnv():AppEnvironment{
			if(instance == null){
				instance = new AppEnvironment(new PrivateAccess());
				instance.initialize();	
			}
			return instance;
		}
		private function initialize():void{
			objectDictionary = new Dictionary();
		}
		public function addSetting(key:String, value:*):void{
			objectDictionary[key] = value;
		}
		public function getSetting(key:String):*{
			return objectDictionary[key];	
		}
		
	}
}
/**
 * @private
 * 
 */
class PrivateAccess{}